package com.ruoyi.invoice.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.invoice.domain.TaxMethods;
import com.ruoyi.invoice.domain.TaxProjects;
import com.ruoyi.invoice.mapper.TaxMethodsMapper;
import com.ruoyi.invoice.mapper.TaxProjectsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.invoice.mapper.InvoiceProductsMapper;
import com.ruoyi.invoice.domain.InvoiceProducts;
import com.ruoyi.invoice.service.IInvoiceProductsService;

/**
 * 开票商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-04
 */
@Service
public class InvoiceProductsServiceImpl implements IInvoiceProductsService 
{
    @Autowired
    private InvoiceProductsMapper invoiceProductsMapper;

    @Autowired
    private TaxMethodsMapper taxMethodsMapper;

    @Autowired
    private TaxProjectsMapper taxProjectsMapper;


    /**
     * 查询开票商品
     * 
     * @param id 开票商品主键
     * @return 开票商品
     */
    @Override
    public InvoiceProducts selectInvoiceProductsById(Long id)
    {
        return invoiceProductsMapper.selectInvoiceProductsById(id);
    }

    /**
     * 查询开票商品列表
     * 
     * @param invoiceProducts 开票商品
     * @return 开票商品
     */
    @Override
    public List<InvoiceProducts> selectInvoiceProductsList(InvoiceProducts invoiceProducts)
    {
        return invoiceProductsMapper.selectInvoiceProductsList(invoiceProducts);
    }

    /**
     * 新增开票商品
     * 
     * @param invoiceProducts 开票商品
     * @return 结果
     */
    @Override
    public int insertInvoiceProducts(InvoiceProducts invoiceProducts)
    {
        return invoiceProductsMapper.insertInvoiceProducts(invoiceProducts);
    }

    /**
     * 修改开票商品
     * 
     * @param invoiceProducts 开票商品
     * @return 结果
     */
    @Override
    public int updateInvoiceProducts(InvoiceProducts invoiceProducts)
    {
        return invoiceProductsMapper.updateInvoiceProducts(invoiceProducts);
    }

    /**
     * 批量删除开票商品
     * 
     * @param ids 需要删除的开票商品主键
     * @return 结果
     */
    @Override
    public int deleteInvoiceProductsByIds(Long[] ids)
    {
        return invoiceProductsMapper.deleteInvoiceProductsByIds(ids);
    }

    /**
     * 删除开票商品信息
     * 
     * @param id 开票商品主键
     * @return 结果
     */
    @Override
    public int deleteInvoiceProductsById(Long id)
    {
        return invoiceProductsMapper.deleteInvoiceProductsById(id);
    }

    /**
     * 查询增税下拉框数据
     * @return
     */
    @Override
    public List<TaxProjects> getTaxProjectsAll() {
        List<TaxProjects> taxProjects = taxProjectsMapper.selectList(null);
        return taxProjects;
    }

    /**
     * 查询计税方法下拉框
     * @return
     */
    @Override
    public List<TaxMethods> getTaxMethodsAll() {
        return taxMethodsMapper.selectList(null);
    }


}
